﻿Imports System.ComponentModel.DataAnnotations

Public Class PatientExamFinding
    Public Property examID() As Short
    <Required()> _
    Public Overloads Property patientId() As Long
    <Required()> _
    Public Property findCategory() As Integer
    <Required()> _
    Public Property findings() As Integer

    Public Property findCategoryName() As String = String.Empty
    Public Property findingsName() As String = String.Empty
    Public Property remarks As String = String.Empty

#Region "NHibernate Composite Key Requirements"
    Public Overrides Function Equals(ByVal obj As Object) As Boolean
        If obj Is Nothing Then Return False
        Dim t = TryCast(obj, PatientExamFinding)
        If t Is Nothing Then Return False
        If patientId = t.patientId AndAlso examID = t.examID Then
            Return True
        End If

        Return False
    End Function
    Public Overrides Function GetHashCode() As Integer
        Dim hash As Integer = 13
        hash += patientId.GetHashCode()
        hash += examID.GetHashCode()

        Return hash
    End Function
#End Region
End Class
